﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="SearchEstate.aspx.cs" Inherits="RealEstateCenter.SearchEstate" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    City :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:DropDownList ID="estate_city" runat="server">          
                <asp:ListItem>Adana</asp:ListItem>

                <asp:ListItem>Adıyaman</asp:ListItem>

                <asp:ListItem>Afyon</asp:ListItem>

                <asp:ListItem>Ağrı</asp:ListItem>

                <asp:ListItem>Amasya</asp:ListItem>

                <asp:ListItem>Ankara</asp:ListItem>

                <asp:ListItem>Antalya</asp:ListItem>

                <asp:ListItem>Artvin</asp:ListItem>

                <asp:ListItem>Aydın</asp:ListItem>

                <asp:ListItem>Balıkesir</asp:ListItem>

                <asp:ListItem>Bilecik</asp:ListItem>

                <asp:ListItem>Bingöl</asp:ListItem>

                <asp:ListItem>Bitlis</asp:ListItem>

                <asp:ListItem>Bolu</asp:ListItem>

                <asp:ListItem>Burdur</asp:ListItem>

                <asp:ListItem>Bursa</asp:ListItem>

                <asp:ListItem>Çanakkale</asp:ListItem>

                <asp:ListItem>Çankırı</asp:ListItem>

                <asp:ListItem>Çorum</asp:ListItem>

                <asp:ListItem>Denizli</asp:ListItem>

                <asp:ListItem>Diyarbakır</asp:ListItem>

                <asp:ListItem>Edirne</asp:ListItem>

                <asp:ListItem>Elazığ</asp:ListItem>

                <asp:ListItem>Erzincan</asp:ListItem>

                <asp:ListItem>Erzurum</asp:ListItem>

                <asp:ListItem>Eskişehir</asp:ListItem>

                <asp:ListItem>Gaziantep</asp:ListItem>

                <asp:ListItem>Giresun</asp:ListItem>

                <asp:ListItem>Gümüşhane</asp:ListItem>

                <asp:ListItem>Hakkari</asp:ListItem>

                <asp:ListItem>Hatay</asp:ListItem>

                <asp:ListItem>Isparta</asp:ListItem>

                <asp:ListItem>İçel</asp:ListItem>

                <asp:ListItem Selected="True">İstanbul</asp:ListItem>

                <asp:ListItem>İzmir</asp:ListItem>

                <asp:ListItem>Kars</asp:ListItem>

                <asp:ListItem>Kastamonu</asp:ListItem>

                <asp:ListItem>Kayseri</asp:ListItem>

                <asp:ListItem>Kırklareli</asp:ListItem>

                <asp:ListItem>Kırşehir</asp:ListItem>

                <asp:ListItem>Kocaeli</asp:ListItem>

                <asp:ListItem>Konya</asp:ListItem>

                <asp:ListItem>Kütahya</asp:ListItem>

                <asp:ListItem>Malatya</asp:ListItem>

                <asp:ListItem>Manisa</asp:ListItem>

                <asp:ListItem>Kahramanmaraş</asp:ListItem>

                <asp:ListItem>Mardin</asp:ListItem>

                <asp:ListItem>Muğla</asp:ListItem>

                <asp:ListItem>Muş</asp:ListItem>

                <asp:ListItem>Nevşehir</asp:ListItem>

                <asp:ListItem>Niğde</asp:ListItem>

                <asp:ListItem>Ordu</asp:ListItem>

                <asp:ListItem>Rize</asp:ListItem>

                <asp:ListItem>Sakarya</asp:ListItem>

                <asp:ListItem>Samsun</asp:ListItem>

                <asp:ListItem>Siirt</asp:ListItem>

                <asp:ListItem>Sinop</asp:ListItem>

                <asp:ListItem>Sivas</asp:ListItem>

                <asp:ListItem>Tekirdağ</asp:ListItem>

                <asp:ListItem>Tokat</asp:ListItem>

                <asp:ListItem>Trabzon</asp:ListItem>

                <asp:ListItem>Tunceli</asp:ListItem>

                <asp:ListItem>Şanlıurfa</asp:ListItem>

                <asp:ListItem>Uşak</asp:ListItem>

                <asp:ListItem>Van</asp:ListItem>

                <asp:ListItem>Yozgat</asp:ListItem>

                <asp:ListItem>Zonduldak</asp:ListItem>

                <asp:ListItem>Aksaray</asp:ListItem>

                <asp:ListItem>Bayburt</asp:ListItem>

                <asp:ListItem>Karaman</asp:ListItem>

                <asp:ListItem>Kırıkkale</asp:ListItem>

                <asp:ListItem>Batman</asp:ListItem>

                <asp:ListItem>Şırnak</asp:ListItem>

                <asp:ListItem>Bartın</asp:ListItem>

                <asp:ListItem>Ardahan</asp:ListItem>

                <asp:ListItem>Iğdır</asp:ListItem>

                <asp:ListItem>Yalova</asp:ListItem>

                <asp:ListItem>Karabük</asp:ListItem>

                <asp:ListItem>Kilis</asp:ListItem>

                <asp:ListItem>Osmaniye</asp:ListItem>

                <asp:ListItem>Düzce</asp:ListItem>
            </asp:DropDownList>
            <br />
            <br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    Room Number:&nbsp;&nbsp;
    <asp:DropDownList ID="RoomNumber" runat="server">
        <asp:ListItem>Any</asp:ListItem>
        <asp:ListItem Value="1+0"></asp:ListItem>
        <asp:ListItem Value="1+1"></asp:ListItem>
        <asp:ListItem Value="2+1"></asp:ListItem>
        <asp:ListItem Value="3+1"></asp:ListItem>
        <asp:ListItem Value="4+1"></asp:ListItem>
        <asp:ListItem Value="5+1"></asp:ListItem>
        <asp:ListItem Value="6+1"></asp:ListItem>
        <asp:ListItem Value="7+1"></asp:ListItem>
        <asp:ListItem Value="7+2"></asp:ListItem>
        <asp:ListItem Value="8+2"></asp:ListItem>
    </asp:DropDownList>
    <br />
    <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    Heating Type :&nbsp;&nbsp;
    <asp:TextBox ID="HeatingType" runat="server"></asp:TextBox>
    <br />
    <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    Type :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:DropDownList ID="Type" runat="server">
        <asp:ListItem Value="Apartment"></asp:ListItem>
        <asp:ListItem Value="Penthouse"></asp:ListItem>
        <asp:ListItem Value="Separate"></asp:ListItem>
        <asp:ListItem Value="Office"></asp:ListItem>
    </asp:DropDownList>
    <br />
    <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Floor 
    :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:TextBox ID="floor" runat="server" Width="25px"></asp:TextBox>
    &nbsp;&nbsp;&nbsp;
    <br />
    <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="Search" runat="server" onclick="Button1_Click" Text="Search" />
    <br />
    <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="estate_id" 
        DataSourceID="SearchEstateSource" Visible="False">
        <Columns>
            <asp:CommandField ShowSelectButton="True" />
            <asp:BoundField DataField="estate_id" HeaderText="estate_id" 
                InsertVisible="False" ReadOnly="True" SortExpression="estate_id" />
            <asp:BoundField DataField="estate_address" HeaderText="estate_address" 
                SortExpression="estate_address" />
            <asp:BoundField DataField="estate_city" HeaderText="estate_city" 
                SortExpression="estate_city" />
            <asp:BoundField DataField="estate_room_number" HeaderText="estate_room_number" 
                SortExpression="estate_room_number" />
            <asp:BoundField DataField="estate_description" HeaderText="estate_description" 
                SortExpression="estate_description" />
            <asp:BoundField DataField="estate_price" HeaderText="estate_price" 
                SortExpression="estate_price" />
            <asp:BoundField DataField="estate_heating_type" 
                HeaderText="estate_heating_type" SortExpression="estate_heating_type" />
            <asp:BoundField DataField="estate_type" HeaderText="estate_type" 
                SortExpression="estate_type" />
            <asp:BoundField DataField="estate_floor" HeaderText="estate_floor" 
                SortExpression="estate_floor" />
            <asp:BoundField DataField="estate_agency_id" HeaderText="estate_agency_id" 
                SortExpression="estate_agency_id" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SearchEstateSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT * FROM [Estate] WHERE (([estate_city] = @estate_city) OR ([estate_room_number] = @estate_room_number) OR ([estate_floor] = @estate_floor) OR ([estate_type] = @estate_type) OR ([estate_heating_type] = @estate_heating_type))">
        <SelectParameters>
            <asp:ControlParameter ControlID="estate_city" DefaultValue="istanbul" 
                Name="estate_city" PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="RoomNumber" DefaultValue="" 
                Name="estate_room_number" PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="floor" DefaultValue="1" Name="estate_floor" 
                PropertyName="Text" Type="Int32" />
            <asp:ControlParameter ControlID="Type" DefaultValue="Apartment" 
                Name="estate_type" PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="HeatingType" DefaultValue="Central Heating" 
                Name="estate_heating_type" PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <br />
    <br />
    <br />
</asp:Content>
